{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "fde4d5c4",
   "metadata": {},
   "source": [
    "# 阶段五模块三作业"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fc854129",
   "metadata": {},
   "source": [
    "## 随机数生成六个班的考试成绩，3门考试：Python、数学、语文。每个班50人\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "f21c01a6",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "7357ece5",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(array([[81,  0, 91],\n",
       "        [65, 62, 85],\n",
       "        [28, 90, 70],\n",
       "        [ 7, 47, 90],\n",
       "        [55, 61, 22],\n",
       "        [83, 23, 69],\n",
       "        [34, 29, 84],\n",
       "        [60, 89, 84],\n",
       "        [22, 63, 67],\n",
       "        [88, 91, 27],\n",
       "        [86, 78,  4],\n",
       "        [83, 63, 35],\n",
       "        [ 7, 93, 86],\n",
       "        [72, 18, 49],\n",
       "        [80, 26, 33],\n",
       "        [14, 83, 79],\n",
       "        [59, 25,  2],\n",
       "        [16, 57, 74],\n",
       "        [ 9, 31, 58],\n",
       "        [93,  8, 39],\n",
       "        [32,  6, 46],\n",
       "        [64, 73, 77],\n",
       "        [82, 64, 48],\n",
       "        [29, 76, 82],\n",
       "        [85, 77, 56],\n",
       "        [71, 78, 60],\n",
       "        [57, 27, 58],\n",
       "        [42, 73, 49],\n",
       "        [88,  2, 99],\n",
       "        [53, 16, 48],\n",
       "        [71, 52,  9],\n",
       "        [57, 93, 46],\n",
       "        [45,  0, 93],\n",
       "        [98, 47, 67],\n",
       "        [17, 52, 29],\n",
       "        [67, 43, 69],\n",
       "        [63, 84,  2],\n",
       "        [34, 29, 48],\n",
       "        [70, 48, 35],\n",
       "        [96, 44, 25],\n",
       "        [91, 77, 53],\n",
       "        [17, 23, 59],\n",
       "        [68, 16, 73],\n",
       "        [24, 43, 83],\n",
       "        [51, 69, 59],\n",
       "        [79,  4, 84],\n",
       "        [72, 38,  2],\n",
       "        [48,  8, 95],\n",
       "        [81, 44, 96],\n",
       "        [40, 78, 26]]),\n",
       " array([[41, 36, 28],\n",
       "        [26, 30, 93],\n",
       "        [36, 48, 56],\n",
       "        [84, 28, 99],\n",
       "        [71, 12,  9],\n",
       "        [27,  9, 68],\n",
       "        [91, 97, 88],\n",
       "        [79, 14, 22],\n",
       "        [21, 66, 14],\n",
       "        [70, 58,  4],\n",
       "        [46, 91, 91],\n",
       "        [65, 18, 20],\n",
       "        [11, 77, 58],\n",
       "        [58, 92, 99],\n",
       "        [62, 31, 11],\n",
       "        [75, 42, 85],\n",
       "        [ 5, 91, 52],\n",
       "        [58, 39, 88],\n",
       "        [ 0, 38, 11],\n",
       "        [66, 10, 82],\n",
       "        [ 8, 14, 80],\n",
       "        [16, 39, 37],\n",
       "        [60, 74, 21],\n",
       "        [29, 43, 49],\n",
       "        [39, 83, 27],\n",
       "        [ 0, 30, 75],\n",
       "        [26, 26,  5],\n",
       "        [39, 28, 95],\n",
       "        [14, 90, 47],\n",
       "        [ 4, 31, 47],\n",
       "        [54,  1, 62],\n",
       "        [63, 24, 57],\n",
       "        [62, 28, 24],\n",
       "        [51, 15, 38],\n",
       "        [55, 76, 51],\n",
       "        [96, 59, 32],\n",
       "        [46,  6,  4],\n",
       "        [86, 17, 73],\n",
       "        [68, 87, 23],\n",
       "        [56, 68, 44],\n",
       "        [55, 16, 56],\n",
       "        [49, 27, 51],\n",
       "        [77,  6,  1],\n",
       "        [38, 46,  0],\n",
       "        [86, 35, 35],\n",
       "        [73, 21, 25],\n",
       "        [ 9, 15, 83],\n",
       "        [36, 86, 91],\n",
       "        [66, 59, 34],\n",
       "        [17, 53, 59]]),\n",
       " array([[ 92,  48,  96],\n",
       "        [ 32,  39,  98],\n",
       "        [ 58,  15,  89],\n",
       "        [ 77,  82,  18],\n",
       "        [ 40,  39,  21],\n",
       "        [ 60,  37,  93],\n",
       "        [ 35,  18,  64],\n",
       "        [ 93,  37,  41],\n",
       "        [ 58,   0,   5],\n",
       "        [  1,  52,  77],\n",
       "        [ 67,  13,  87],\n",
       "        [ 70,  23,  27],\n",
       "        [ 84,  48,  94],\n",
       "        [ 17,  89,  32],\n",
       "        [ 53,  73,  14],\n",
       "        [ 17,  70,  18],\n",
       "        [ 54,  20,  32],\n",
       "        [ 87,  43,  74],\n",
       "        [ 58,  50,  79],\n",
       "        [ 49,  60,  89],\n",
       "        [ 44,  24,  63],\n",
       "        [ 35,  97,  39],\n",
       "        [ 60,  32,  51],\n",
       "        [ 43,  62,  31],\n",
       "        [ 54,  88,   6],\n",
       "        [ 40,  30,  87],\n",
       "        [ 72,  48,  82],\n",
       "        [ 79,  25,  81],\n",
       "        [ 10,  66,   7],\n",
       "        [100,  91,   4],\n",
       "        [100,  47,  34],\n",
       "        [ 61,  20,  53],\n",
       "        [ 74,  29,  30],\n",
       "        [ 90,  23,  13],\n",
       "        [  4,  54,  90],\n",
       "        [ 63,  49,  21],\n",
       "        [ 20,  12,  21],\n",
       "        [ 15,  80,  75],\n",
       "        [ 48,   9,  99],\n",
       "        [ 43,  73,  17],\n",
       "        [100,  52,  69],\n",
       "        [  4,  81,   9],\n",
       "        [ 78,  45,   5],\n",
       "        [ 91,  94,  66],\n",
       "        [ 64,   3,  83],\n",
       "        [  4,  10,  25],\n",
       "        [ 91,  40,   0],\n",
       "        [ 30,   4,  73],\n",
       "        [ 96,  57,  23],\n",
       "        [ 64,  80,  86]]),\n",
       " array([[97, 21, 30],\n",
       "        [ 0, 67, 92],\n",
       "        [90, 75, 29],\n",
       "        [34, 41, 52],\n",
       "        [ 7, 28, 87],\n",
       "        [51, 12, 20],\n",
       "        [93, 25, 90],\n",
       "        [67, 74, 53],\n",
       "        [26, 34, 18],\n",
       "        [44, 55, 27],\n",
       "        [75,  0,  2],\n",
       "        [14, 16, 31],\n",
       "        [21, 78, 86],\n",
       "        [ 7, 82, 47],\n",
       "        [18,  3, 76],\n",
       "        [87, 59,  5],\n",
       "        [12, 23, 79],\n",
       "        [72, 78, 40],\n",
       "        [18, 44, 21],\n",
       "        [75, 91, 13],\n",
       "        [95, 56, 74],\n",
       "        [12, 73, 33],\n",
       "        [66, 69,  0],\n",
       "        [69, 99, 97],\n",
       "        [55,  4, 29],\n",
       "        [60, 21, 61],\n",
       "        [85, 61, 94],\n",
       "        [31,  0,  6],\n",
       "        [69, 66, 63],\n",
       "        [55, 58, 62],\n",
       "        [52, 32, 64],\n",
       "        [54, 73, 90],\n",
       "        [86, 45, 85],\n",
       "        [96, 83, 92],\n",
       "        [38, 43, 76],\n",
       "        [91, 15, 72],\n",
       "        [66, 90, 78],\n",
       "        [48, 95, 18],\n",
       "        [50, 74,  0],\n",
       "        [11, 65, 87],\n",
       "        [57, 90, 23],\n",
       "        [90, 38,  5],\n",
       "        [64, 56,  2],\n",
       "        [51, 69, 92],\n",
       "        [58, 31, 21],\n",
       "        [27,  4, 35],\n",
       "        [59, 47, 30],\n",
       "        [83, 24, 85],\n",
       "        [22, 45, 97],\n",
       "        [86, 43, 60]]),\n",
       " array([[ 43,  13,  68],\n",
       "        [ 48,  65,  12],\n",
       "        [ 74,   0,  50],\n",
       "        [ 63,  52,  91],\n",
       "        [  1,   9,   2],\n",
       "        [ 79,  34,  41],\n",
       "        [ 61,  42,  30],\n",
       "        [ 23,  29, 100],\n",
       "        [  9,  74,  61],\n",
       "        [ 42,  30,  75],\n",
       "        [ 31,  44,  76],\n",
       "        [ 35,   0,  93],\n",
       "        [  1,  15,  87],\n",
       "        [  0,  79,  29],\n",
       "        [ 94,  27,  89],\n",
       "        [  2,  11,  92],\n",
       "        [ 61,  87,  28],\n",
       "        [ 97,  55,  89],\n",
       "        [ 27,   6,  17],\n",
       "        [ 85,  63,  54],\n",
       "        [ 84,  22,  32],\n",
       "        [ 14,  48,  93],\n",
       "        [ 33, 100,  48],\n",
       "        [ 43,  46,  33],\n",
       "        [ 27,  59,  80],\n",
       "        [ 62,  46,  34],\n",
       "        [ 59,   7,  92],\n",
       "        [  7,  72,  78],\n",
       "        [ 38,  88,   3],\n",
       "        [ 74,  78,  33],\n",
       "        [ 97,  98,  66],\n",
       "        [ 78,  20,  53],\n",
       "        [ 31,   5,  79],\n",
       "        [ 50,  12,  60],\n",
       "        [ 11,  93,  39],\n",
       "        [ 41,  99,  99],\n",
       "        [ 16, 100,  68],\n",
       "        [ 79,  82,  11],\n",
       "        [  5,  33,  27],\n",
       "        [ 55,  89,  63],\n",
       "        [ 41,  70,  68],\n",
       "        [  9,   4,  35],\n",
       "        [  1,  34,  29],\n",
       "        [ 99,  95,  31],\n",
       "        [ 76,  90,  21],\n",
       "        [ 38,  23,  76],\n",
       "        [ 61,  60,   9],\n",
       "        [ 58,  49,  50],\n",
       "        [ 48,  74,  18],\n",
       "        [ 50,  98,  26]]),\n",
       " array([[ 62,   5,  99],\n",
       "        [ 23,  43,   2],\n",
       "        [ 44,  87,  63],\n",
       "        [ 82,  44,  60],\n",
       "        [ 46,  40,  15],\n",
       "        [ 44,  94,  67],\n",
       "        [ 26,  51,  83],\n",
       "        [ 39,  17,  87],\n",
       "        [ 47,  23,  39],\n",
       "        [  6,   7, 100],\n",
       "        [ 20,  23,  93],\n",
       "        [ 47,  64,  41],\n",
       "        [ 69,  10,  54],\n",
       "        [ 10,  99,  84],\n",
       "        [ 74,  75,  91],\n",
       "        [ 83,  77,  15],\n",
       "        [ 55,  82,  19],\n",
       "        [ 63,  98,  65],\n",
       "        [ 55,  11,  28],\n",
       "        [ 32,  80,  48],\n",
       "        [ 56,  73,  70],\n",
       "        [ 14,  24,  83],\n",
       "        [ 89,  69,  48],\n",
       "        [ 89,  72,  19],\n",
       "        [ 96,   4,  63],\n",
       "        [ 67,  25,  45],\n",
       "        [ 63,  51,  16],\n",
       "        [ 34,  60,  55],\n",
       "        [ 68,  15,  36],\n",
       "        [ 75,  48,  33],\n",
       "        [ 88,  43,   3],\n",
       "        [ 95,  13,  26],\n",
       "        [ 81,  86,  80],\n",
       "        [  6,  90,  27],\n",
       "        [ 47,  53,  85],\n",
       "        [ 43,  28,  21],\n",
       "        [ 79,  90,  37],\n",
       "        [ 16,  22, 100],\n",
       "        [ 18,  74,  72],\n",
       "        [ 33,  40,  41],\n",
       "        [ 52,   8,  21],\n",
       "        [ 24,   9,  95],\n",
       "        [ 27,   3,  74],\n",
       "        [  2,  48,  79],\n",
       "        [ 25,  29,   8],\n",
       "        [ 99,  55,   1],\n",
       "        [ 47,  70,  95],\n",
       "        [ 99,  43,  33],\n",
       "        [  9,  28,  91],\n",
       "        [ 70,  49,  70]]))"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "class1 = np.random.randint(0,101,size=(50,3))\n",
    "class2 = np.random.randint(0,101,size=(50,3))\n",
    "class3 = np.random.randint(0,101,size=(50,3))\n",
    "class4 = np.random.randint(0,101,size=(50,3))\n",
    "class5 = np.random.randint(0,101,size=(50,3))\n",
    "class6 = np.random.randint(0,101,size=(50,3))\n",
    "class1,class2,class3,class4,class5,class6"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "38885656",
   "metadata": {},
   "source": [
    "## 将六个班的考试成绩进行合并得到score"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "7f14fa25",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(300, 3)"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "score = np.vstack((class1,class2,class3,class4,class5,class6))\n",
    "np.shape(score)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d174b9d4",
   "metadata": {},
   "source": [
    "## 生成性别数组sex，水平叠加数组sex和score得到data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "bc85c8d5",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [1],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1],\n",
       "       [0],\n",
       "       [1]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 性别 ：男 1 女 0\n",
    "sex = np.random.randint(0,2,size=(300,1))\n",
    "np.shape(sex)\n",
    "display(sex)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "8cad62f9",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[81,  0, 91,  0],\n",
       "       [65, 62, 85,  0],\n",
       "       [28, 90, 70,  0],\n",
       "       ...,\n",
       "       [99, 43, 33,  1],\n",
       "       [ 9, 28, 91,  1],\n",
       "       [70, 49, 70,  1]])"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data = np.hstack((score,sex))\n",
    "data"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "79072593",
   "metadata": {},
   "source": [
    "## 分别计算男女生各科成绩统计指标：最小值、最大值、平均分、中位数、标准差"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "id": "10665e76",
   "metadata": {
    "code_folding": []
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "\n",
    "def split(arr, cond):\n",
    "    return [arr[cond], arr[~cond]]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "id": "9539e272",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 60,  89,  84,   1],\n",
       "       [ 88,  91,  27,   1],\n",
       "       [ 86,  78,   4,   1],\n",
       "       [ 83,  63,  35,   1],\n",
       "       [ 72,  18,  49,   1],\n",
       "       [ 14,  83,  79,   1],\n",
       "       [ 16,  57,  74,   1],\n",
       "       [ 71,  78,  60,   1],\n",
       "       [ 42,  73,  49,   1],\n",
       "       [ 88,   2,  99,   1],\n",
       "       [ 53,  16,  48,   1],\n",
       "       [ 71,  52,   9,   1],\n",
       "       [ 57,  93,  46,   1],\n",
       "       [ 45,   0,  93,   1],\n",
       "       [ 98,  47,  67,   1],\n",
       "       [ 17,  52,  29,   1],\n",
       "       [ 67,  43,  69,   1],\n",
       "       [ 63,  84,   2,   1],\n",
       "       [ 34,  29,  48,   1],\n",
       "       [ 70,  48,  35,   1],\n",
       "       [ 96,  44,  25,   1],\n",
       "       [ 68,  16,  73,   1],\n",
       "       [ 24,  43,  83,   1],\n",
       "       [ 51,  69,  59,   1],\n",
       "       [ 72,  38,   2,   1],\n",
       "       [ 81,  44,  96,   1],\n",
       "       [ 26,  30,  93,   1],\n",
       "       [ 36,  48,  56,   1],\n",
       "       [ 84,  28,  99,   1],\n",
       "       [ 71,  12,   9,   1],\n",
       "       [ 91,  97,  88,   1],\n",
       "       [ 79,  14,  22,   1],\n",
       "       [ 21,  66,  14,   1],\n",
       "       [ 70,  58,   4,   1],\n",
       "       [ 65,  18,  20,   1],\n",
       "       [ 11,  77,  58,   1],\n",
       "       [ 62,  31,  11,   1],\n",
       "       [ 75,  42,  85,   1],\n",
       "       [  5,  91,  52,   1],\n",
       "       [ 58,  39,  88,   1],\n",
       "       [  0,  38,  11,   1],\n",
       "       [ 66,  10,  82,   1],\n",
       "       [  8,  14,  80,   1],\n",
       "       [ 29,  43,  49,   1],\n",
       "       [ 39,  83,  27,   1],\n",
       "       [  0,  30,  75,   1],\n",
       "       [ 39,  28,  95,   1],\n",
       "       [ 14,  90,  47,   1],\n",
       "       [  4,  31,  47,   1],\n",
       "       [ 63,  24,  57,   1],\n",
       "       [ 62,  28,  24,   1],\n",
       "       [ 51,  15,  38,   1],\n",
       "       [ 96,  59,  32,   1],\n",
       "       [ 86,  17,  73,   1],\n",
       "       [ 68,  87,  23,   1],\n",
       "       [ 38,  46,   0,   1],\n",
       "       [ 73,  21,  25,   1],\n",
       "       [  9,  15,  83,   1],\n",
       "       [ 36,  86,  91,   1],\n",
       "       [ 17,  53,  59,   1],\n",
       "       [ 92,  48,  96,   1],\n",
       "       [ 58,  15,  89,   1],\n",
       "       [ 77,  82,  18,   1],\n",
       "       [ 60,  37,  93,   1],\n",
       "       [ 93,  37,  41,   1],\n",
       "       [ 58,   0,   5,   1],\n",
       "       [  1,  52,  77,   1],\n",
       "       [ 53,  73,  14,   1],\n",
       "       [ 17,  70,  18,   1],\n",
       "       [ 87,  43,  74,   1],\n",
       "       [ 58,  50,  79,   1],\n",
       "       [ 35,  97,  39,   1],\n",
       "       [ 54,  88,   6,   1],\n",
       "       [100,  91,   4,   1],\n",
       "       [100,  47,  34,   1],\n",
       "       [ 74,  29,  30,   1],\n",
       "       [ 90,  23,  13,   1],\n",
       "       [  4,  54,  90,   1],\n",
       "       [ 15,  80,  75,   1],\n",
       "       [ 48,   9,  99,   1],\n",
       "       [ 43,  73,  17,   1],\n",
       "       [100,  52,  69,   1],\n",
       "       [ 78,  45,   5,   1],\n",
       "       [ 91,  94,  66,   1],\n",
       "       [ 96,  57,  23,   1],\n",
       "       [  0,  67,  92,   1],\n",
       "       [ 51,  12,  20,   1],\n",
       "       [ 44,  55,  27,   1],\n",
       "       [ 75,   0,   2,   1],\n",
       "       [ 14,  16,  31,   1],\n",
       "       [ 21,  78,  86,   1],\n",
       "       [ 18,   3,  76,   1],\n",
       "       [ 75,  91,  13,   1],\n",
       "       [ 95,  56,  74,   1],\n",
       "       [ 12,  73,  33,   1],\n",
       "       [ 69,  99,  97,   1],\n",
       "       [ 55,   4,  29,   1],\n",
       "       [ 91,  15,  72,   1],\n",
       "       [ 66,  90,  78,   1],\n",
       "       [ 48,  95,  18,   1],\n",
       "       [ 11,  65,  87,   1],\n",
       "       [ 64,  56,   2,   1],\n",
       "       [ 59,  47,  30,   1],\n",
       "       [ 83,  24,  85,   1],\n",
       "       [ 63,  52,  91,   1],\n",
       "       [  1,   9,   2,   1],\n",
       "       [ 79,  34,  41,   1],\n",
       "       [  9,  74,  61,   1],\n",
       "       [ 31,  44,  76,   1],\n",
       "       [ 27,   6,  17,   1],\n",
       "       [ 85,  63,  54,   1],\n",
       "       [ 84,  22,  32,   1],\n",
       "       [ 33, 100,  48,   1],\n",
       "       [ 43,  46,  33,   1],\n",
       "       [ 27,  59,  80,   1],\n",
       "       [ 59,   7,  92,   1],\n",
       "       [ 97,  98,  66,   1],\n",
       "       [ 78,  20,  53,   1],\n",
       "       [ 41,  99,  99,   1],\n",
       "       [ 55,  89,  63,   1],\n",
       "       [ 41,  70,  68,   1],\n",
       "       [ 99,  95,  31,   1],\n",
       "       [ 76,  90,  21,   1],\n",
       "       [ 38,  23,  76,   1],\n",
       "       [ 58,  49,  50,   1],\n",
       "       [ 48,  74,  18,   1],\n",
       "       [ 50,  98,  26,   1],\n",
       "       [ 44,  87,  63,   1],\n",
       "       [ 46,  40,  15,   1],\n",
       "       [ 44,  94,  67,   1],\n",
       "       [ 26,  51,  83,   1],\n",
       "       [ 47,  23,  39,   1],\n",
       "       [ 20,  23,  93,   1],\n",
       "       [ 47,  64,  41,   1],\n",
       "       [ 69,  10,  54,   1],\n",
       "       [ 74,  75,  91,   1],\n",
       "       [ 55,  11,  28,   1],\n",
       "       [ 32,  80,  48,   1],\n",
       "       [ 56,  73,  70,   1],\n",
       "       [ 14,  24,  83,   1],\n",
       "       [ 89,  69,  48,   1],\n",
       "       [ 89,  72,  19,   1],\n",
       "       [ 67,  25,  45,   1],\n",
       "       [ 63,  51,  16,   1],\n",
       "       [ 68,  15,  36,   1],\n",
       "       [ 88,  43,   3,   1],\n",
       "       [ 95,  13,  26,   1],\n",
       "       [  6,  90,  27,   1],\n",
       "       [ 43,  28,  21,   1],\n",
       "       [ 33,  40,  41,   1],\n",
       "       [ 24,   9,  95,   1],\n",
       "       [  2,  48,  79,   1],\n",
       "       [ 25,  29,   8,   1],\n",
       "       [ 99,  43,  33,   1],\n",
       "       [  9,  28,  91,   1],\n",
       "       [ 70,  49,  70,   1]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([[ 81,   0,  91,   0],\n",
       "       [ 65,  62,  85,   0],\n",
       "       [ 28,  90,  70,   0],\n",
       "       [  7,  47,  90,   0],\n",
       "       [ 55,  61,  22,   0],\n",
       "       [ 83,  23,  69,   0],\n",
       "       [ 34,  29,  84,   0],\n",
       "       [ 22,  63,  67,   0],\n",
       "       [  7,  93,  86,   0],\n",
       "       [ 80,  26,  33,   0],\n",
       "       [ 59,  25,   2,   0],\n",
       "       [  9,  31,  58,   0],\n",
       "       [ 93,   8,  39,   0],\n",
       "       [ 32,   6,  46,   0],\n",
       "       [ 64,  73,  77,   0],\n",
       "       [ 82,  64,  48,   0],\n",
       "       [ 29,  76,  82,   0],\n",
       "       [ 85,  77,  56,   0],\n",
       "       [ 57,  27,  58,   0],\n",
       "       [ 91,  77,  53,   0],\n",
       "       [ 17,  23,  59,   0],\n",
       "       [ 79,   4,  84,   0],\n",
       "       [ 48,   8,  95,   0],\n",
       "       [ 40,  78,  26,   0],\n",
       "       [ 41,  36,  28,   0],\n",
       "       [ 27,   9,  68,   0],\n",
       "       [ 46,  91,  91,   0],\n",
       "       [ 58,  92,  99,   0],\n",
       "       [ 16,  39,  37,   0],\n",
       "       [ 60,  74,  21,   0],\n",
       "       [ 26,  26,   5,   0],\n",
       "       [ 54,   1,  62,   0],\n",
       "       [ 55,  76,  51,   0],\n",
       "       [ 46,   6,   4,   0],\n",
       "       [ 56,  68,  44,   0],\n",
       "       [ 55,  16,  56,   0],\n",
       "       [ 49,  27,  51,   0],\n",
       "       [ 77,   6,   1,   0],\n",
       "       [ 86,  35,  35,   0],\n",
       "       [ 66,  59,  34,   0],\n",
       "       [ 32,  39,  98,   0],\n",
       "       [ 40,  39,  21,   0],\n",
       "       [ 35,  18,  64,   0],\n",
       "       [ 67,  13,  87,   0],\n",
       "       [ 70,  23,  27,   0],\n",
       "       [ 84,  48,  94,   0],\n",
       "       [ 17,  89,  32,   0],\n",
       "       [ 54,  20,  32,   0],\n",
       "       [ 49,  60,  89,   0],\n",
       "       [ 44,  24,  63,   0],\n",
       "       [ 60,  32,  51,   0],\n",
       "       [ 43,  62,  31,   0],\n",
       "       [ 40,  30,  87,   0],\n",
       "       [ 72,  48,  82,   0],\n",
       "       [ 79,  25,  81,   0],\n",
       "       [ 10,  66,   7,   0],\n",
       "       [ 61,  20,  53,   0],\n",
       "       [ 63,  49,  21,   0],\n",
       "       [ 20,  12,  21,   0],\n",
       "       [  4,  81,   9,   0],\n",
       "       [ 64,   3,  83,   0],\n",
       "       [  4,  10,  25,   0],\n",
       "       [ 91,  40,   0,   0],\n",
       "       [ 30,   4,  73,   0],\n",
       "       [ 64,  80,  86,   0],\n",
       "       [ 97,  21,  30,   0],\n",
       "       [ 90,  75,  29,   0],\n",
       "       [ 34,  41,  52,   0],\n",
       "       [  7,  28,  87,   0],\n",
       "       [ 93,  25,  90,   0],\n",
       "       [ 67,  74,  53,   0],\n",
       "       [ 26,  34,  18,   0],\n",
       "       [  7,  82,  47,   0],\n",
       "       [ 87,  59,   5,   0],\n",
       "       [ 12,  23,  79,   0],\n",
       "       [ 72,  78,  40,   0],\n",
       "       [ 18,  44,  21,   0],\n",
       "       [ 66,  69,   0,   0],\n",
       "       [ 60,  21,  61,   0],\n",
       "       [ 85,  61,  94,   0],\n",
       "       [ 31,   0,   6,   0],\n",
       "       [ 69,  66,  63,   0],\n",
       "       [ 55,  58,  62,   0],\n",
       "       [ 52,  32,  64,   0],\n",
       "       [ 54,  73,  90,   0],\n",
       "       [ 86,  45,  85,   0],\n",
       "       [ 96,  83,  92,   0],\n",
       "       [ 38,  43,  76,   0],\n",
       "       [ 50,  74,   0,   0],\n",
       "       [ 57,  90,  23,   0],\n",
       "       [ 90,  38,   5,   0],\n",
       "       [ 51,  69,  92,   0],\n",
       "       [ 58,  31,  21,   0],\n",
       "       [ 27,   4,  35,   0],\n",
       "       [ 22,  45,  97,   0],\n",
       "       [ 86,  43,  60,   0],\n",
       "       [ 43,  13,  68,   0],\n",
       "       [ 48,  65,  12,   0],\n",
       "       [ 74,   0,  50,   0],\n",
       "       [ 61,  42,  30,   0],\n",
       "       [ 23,  29, 100,   0],\n",
       "       [ 42,  30,  75,   0],\n",
       "       [ 35,   0,  93,   0],\n",
       "       [  1,  15,  87,   0],\n",
       "       [  0,  79,  29,   0],\n",
       "       [ 94,  27,  89,   0],\n",
       "       [  2,  11,  92,   0],\n",
       "       [ 61,  87,  28,   0],\n",
       "       [ 97,  55,  89,   0],\n",
       "       [ 14,  48,  93,   0],\n",
       "       [ 62,  46,  34,   0],\n",
       "       [  7,  72,  78,   0],\n",
       "       [ 38,  88,   3,   0],\n",
       "       [ 74,  78,  33,   0],\n",
       "       [ 31,   5,  79,   0],\n",
       "       [ 50,  12,  60,   0],\n",
       "       [ 11,  93,  39,   0],\n",
       "       [ 16, 100,  68,   0],\n",
       "       [ 79,  82,  11,   0],\n",
       "       [  5,  33,  27,   0],\n",
       "       [  9,   4,  35,   0],\n",
       "       [  1,  34,  29,   0],\n",
       "       [ 61,  60,   9,   0],\n",
       "       [ 62,   5,  99,   0],\n",
       "       [ 23,  43,   2,   0],\n",
       "       [ 82,  44,  60,   0],\n",
       "       [ 39,  17,  87,   0],\n",
       "       [  6,   7, 100,   0],\n",
       "       [ 10,  99,  84,   0],\n",
       "       [ 83,  77,  15,   0],\n",
       "       [ 55,  82,  19,   0],\n",
       "       [ 63,  98,  65,   0],\n",
       "       [ 96,   4,  63,   0],\n",
       "       [ 34,  60,  55,   0],\n",
       "       [ 75,  48,  33,   0],\n",
       "       [ 81,  86,  80,   0],\n",
       "       [ 47,  53,  85,   0],\n",
       "       [ 79,  90,  37,   0],\n",
       "       [ 16,  22, 100,   0],\n",
       "       [ 18,  74,  72,   0],\n",
       "       [ 52,   8,  21,   0],\n",
       "       [ 27,   3,  74,   0],\n",
       "       [ 99,  55,   1,   0],\n",
       "       [ 47,  70,  95,   0]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "\n",
    "m = split(data,data[:,-1] == 1 )[0] # 将男女分开，m为男生数据，w为女生数据\n",
    "w = split(data,data[:,-1] == 1 )[1]\n",
    "\n",
    "display(m,w)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "id": "25effb33",
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 60,  88,  86,  83,  72,  14,  16,  71,  42,  88,  53,  71,  57,\n",
       "         45,  98,  17,  67,  63,  34,  70,  96,  68,  24,  51,  72,  81,\n",
       "         26,  36,  84,  71,  91,  79,  21,  70,  65,  11,  62,  75,   5,\n",
       "         58,   0,  66,   8,  29,  39,   0,  39,  14,   4,  63,  62,  51,\n",
       "         96,  86,  68,  38,  73,   9,  36,  17,  92,  58,  77,  60,  93,\n",
       "         58,   1,  53,  17,  87,  58,  35,  54, 100, 100,  74,  90,   4,\n",
       "         15,  48,  43, 100,  78,  91,  96,   0,  51,  44,  75,  14,  21,\n",
       "         18,  75,  95,  12,  69,  55,  91,  66,  48,  11,  64,  59,  83,\n",
       "         63,   1,  79,   9,  31,  27,  85,  84,  33,  43,  27,  59,  97,\n",
       "         78,  41,  55,  41,  99,  76,  38,  58,  48,  50,  44,  46,  44,\n",
       "         26,  47,  20,  47,  69,  74,  55,  32,  56,  14,  89,  89,  67,\n",
       "         63,  68,  88,  95,   6,  43,  33,  24,   2,  25,  99,   9,  70],\n",
       "       [ 89,  91,  78,  63,  18,  83,  57,  78,  73,   2,  16,  52,  93,\n",
       "          0,  47,  52,  43,  84,  29,  48,  44,  16,  43,  69,  38,  44,\n",
       "         30,  48,  28,  12,  97,  14,  66,  58,  18,  77,  31,  42,  91,\n",
       "         39,  38,  10,  14,  43,  83,  30,  28,  90,  31,  24,  28,  15,\n",
       "         59,  17,  87,  46,  21,  15,  86,  53,  48,  15,  82,  37,  37,\n",
       "          0,  52,  73,  70,  43,  50,  97,  88,  91,  47,  29,  23,  54,\n",
       "         80,   9,  73,  52,  45,  94,  57,  67,  12,  55,   0,  16,  78,\n",
       "          3,  91,  56,  73,  99,   4,  15,  90,  95,  65,  56,  47,  24,\n",
       "         52,   9,  34,  74,  44,   6,  63,  22, 100,  46,  59,   7,  98,\n",
       "         20,  99,  89,  70,  95,  90,  23,  49,  74,  98,  87,  40,  94,\n",
       "         51,  23,  23,  64,  10,  75,  11,  80,  73,  24,  69,  72,  25,\n",
       "         51,  15,  43,  13,  90,  28,  40,   9,  48,  29,  43,  28,  49],\n",
       "       [ 84,  27,   4,  35,  49,  79,  74,  60,  49,  99,  48,   9,  46,\n",
       "         93,  67,  29,  69,   2,  48,  35,  25,  73,  83,  59,   2,  96,\n",
       "         93,  56,  99,   9,  88,  22,  14,   4,  20,  58,  11,  85,  52,\n",
       "         88,  11,  82,  80,  49,  27,  75,  95,  47,  47,  57,  24,  38,\n",
       "         32,  73,  23,   0,  25,  83,  91,  59,  96,  89,  18,  93,  41,\n",
       "          5,  77,  14,  18,  74,  79,  39,   6,   4,  34,  30,  13,  90,\n",
       "         75,  99,  17,  69,   5,  66,  23,  92,  20,  27,   2,  31,  86,\n",
       "         76,  13,  74,  33,  97,  29,  72,  78,  18,  87,   2,  30,  85,\n",
       "         91,   2,  41,  61,  76,  17,  54,  32,  48,  33,  80,  92,  66,\n",
       "         53,  99,  63,  68,  31,  21,  76,  50,  18,  26,  63,  15,  67,\n",
       "         83,  39,  93,  41,  54,  91,  28,  48,  70,  83,  48,  19,  45,\n",
       "         16,  36,   3,  26,  27,  21,  41,  95,  79,   8,  33,  91,  70],\n",
       "       [  1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,\n",
       "          1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,\n",
       "          1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,\n",
       "          1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,\n",
       "          1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,\n",
       "          1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,\n",
       "          1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,\n",
       "          1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,\n",
       "          1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,\n",
       "          1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,\n",
       "          1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,\n",
       "          1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1,   1]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array([[ 81,  65,  28,   7,  55,  83,  34,  22,   7,  80,  59,   9,  93,\n",
       "         32,  64,  82,  29,  85,  57,  91,  17,  79,  48,  40,  41,  27,\n",
       "         46,  58,  16,  60,  26,  54,  55,  46,  56,  55,  49,  77,  86,\n",
       "         66,  32,  40,  35,  67,  70,  84,  17,  54,  49,  44,  60,  43,\n",
       "         40,  72,  79,  10,  61,  63,  20,   4,  64,   4,  91,  30,  64,\n",
       "         97,  90,  34,   7,  93,  67,  26,   7,  87,  12,  72,  18,  66,\n",
       "         60,  85,  31,  69,  55,  52,  54,  86,  96,  38,  50,  57,  90,\n",
       "         51,  58,  27,  22,  86,  43,  48,  74,  61,  23,  42,  35,   1,\n",
       "          0,  94,   2,  61,  97,  14,  62,   7,  38,  74,  31,  50,  11,\n",
       "         16,  79,   5,   9,   1,  61,  62,  23,  82,  39,   6,  10,  83,\n",
       "         55,  63,  96,  34,  75,  81,  47,  79,  16,  18,  52,  27,  99,\n",
       "         47],\n",
       "       [  0,  62,  90,  47,  61,  23,  29,  63,  93,  26,  25,  31,   8,\n",
       "          6,  73,  64,  76,  77,  27,  77,  23,   4,   8,  78,  36,   9,\n",
       "         91,  92,  39,  74,  26,   1,  76,   6,  68,  16,  27,   6,  35,\n",
       "         59,  39,  39,  18,  13,  23,  48,  89,  20,  60,  24,  32,  62,\n",
       "         30,  48,  25,  66,  20,  49,  12,  81,   3,  10,  40,   4,  80,\n",
       "         21,  75,  41,  28,  25,  74,  34,  82,  59,  23,  78,  44,  69,\n",
       "         21,  61,   0,  66,  58,  32,  73,  45,  83,  43,  74,  90,  38,\n",
       "         69,  31,   4,  45,  43,  13,  65,   0,  42,  29,  30,   0,  15,\n",
       "         79,  27,  11,  87,  55,  48,  46,  72,  88,  78,   5,  12,  93,\n",
       "        100,  82,  33,   4,  34,  60,   5,  43,  44,  17,   7,  99,  77,\n",
       "         82,  98,   4,  60,  48,  86,  53,  90,  22,  74,   8,   3,  55,\n",
       "         70],\n",
       "       [ 91,  85,  70,  90,  22,  69,  84,  67,  86,  33,   2,  58,  39,\n",
       "         46,  77,  48,  82,  56,  58,  53,  59,  84,  95,  26,  28,  68,\n",
       "         91,  99,  37,  21,   5,  62,  51,   4,  44,  56,  51,   1,  35,\n",
       "         34,  98,  21,  64,  87,  27,  94,  32,  32,  89,  63,  51,  31,\n",
       "         87,  82,  81,   7,  53,  21,  21,   9,  83,  25,   0,  73,  86,\n",
       "         30,  29,  52,  87,  90,  53,  18,  47,   5,  79,  40,  21,   0,\n",
       "         61,  94,   6,  63,  62,  64,  90,  85,  92,  76,   0,  23,   5,\n",
       "         92,  21,  35,  97,  60,  68,  12,  50,  30, 100,  75,  93,  87,\n",
       "         29,  89,  92,  28,  89,  93,  34,  78,   3,  33,  79,  60,  39,\n",
       "         68,  11,  27,  35,  29,   9,  99,   2,  60,  87, 100,  84,  15,\n",
       "         19,  65,  63,  55,  33,  80,  85,  37, 100,  72,  21,  74,   1,\n",
       "         95],\n",
       "       [  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,\n",
       "          0]])"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 转置 \n",
    "M = m.T\n",
    "W = w.T\n",
    "display(M,W)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "id": "465d356a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0"
      ]
     },
     "execution_count": 92,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "M[0,:].min()   # 科目一 python 男生最低分\n",
    "W[0,:].min()   # 科目一 python 女生最低分\n",
    "\n",
    "M[1,:].min()   # 科目二 数学 男生最低分\n",
    "W[1,:].min()   # 科目二 数学 女生最低分\n",
    "\n",
    "M[2,:].min()   # 科目三 语文 男生最低分\n",
    "W[2,:].min()   # 科目三 语文 女生最低分"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "id": "5a1e4e2d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "99"
      ]
     },
     "execution_count": 91,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "M[0,:].max()   # 科目一 python 男生最高分\n",
    "W[0,:].max()   # 科目一 python 女生最高分\n",
    "\n",
    "M[1,:].max()   # 科目二 数学 男生最高分\n",
    "W[1,:].max()   # 科目二 数学 女生最高分\n",
    "\n",
    "M[2,:].max()   # 科目三 语文 男生最高分\n",
    "W[2,:].max()   # 科目三 语文 女生最高分"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "id": "7072c7cb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "53.44871794871795"
      ]
     },
     "execution_count": 93,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.mean(M[0,:])  #科目一 python 男生平均分\n",
    "np.mean(W[0,:])  #科目一 python 女生平均分\n",
    "\n",
    "np.mean(M[1,:])  #科目二 数学 男生平均分\n",
    "np.mean(W[1,:])  #科目二 数学 女生平均分\n",
    "\n",
    "np.mean(M[2,:])  #科目三 语文 男生平均分\n",
    "np.mean(W[2,:])  #科目三 语文 女生平均分\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "id": "f15b82b3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "52.0"
      ]
     },
     "execution_count": 95,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.median(M[0,:])  #科目一 python 男生中位数\n",
    "np.median(W[0,:])  #科目一 python 女生中位数\n",
    "\n",
    "np.median(M[1,:])  #科目二 数学 男生中位数\n",
    "np.median(W[1,:])  #科目二 数学 女生中位数\n",
    "\n",
    "np.median(M[2,:])  #科目三 语文 男生中位数\n",
    "np.median(W[2,:])  #科目三 语文 女生中位数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "id": "850cc246",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "28.504451940137816"
      ]
     },
     "execution_count": 96,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.std(M[0,:])  #科目一 python 男生标准差\n",
    "np.std(W[0,:])  #科目一 python 女生标准差\n",
    "\n",
    "np.std(M[1,:])  #科目二 数学 男生标准差\n",
    "np.std(W[1,:])  #科目二 数学 女生标准差\n",
    "\n",
    "np.std(M[2,:])  #科目三 语文 男生标准差\n",
    "np.std(W[2,:])  #科目三 语文 女生标准差"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.2"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
